package io.github.junxworks.qt.modules.tushare.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import io.github.junxworks.ep.core.orm.BaseMapper;
import io.github.junxworks.qt.config.ds.Sharding;
import io.github.junxworks.qt.modules.tushare.entity.DStockIndexBasic;

@Sharding
public interface IndexMapper extends BaseMapper {

	@Delete("delete from d_stock_index_basic where market = #{market}")
	int deleteIndexDataByMarket(@Param("market") String market);

	@Select("select * from d_stock_index_basic where exp_date is null or exp_date>=#{expDate}")
	List<DStockIndexBasic> queryAllIndexBasic(@Param("expDate") String expDate);

	@Delete("delete from d_stock_index_weekly where trade_date = #{tradeDate}")
	int deleteIndexWeeklyByTradeDate(@Param("tradeDate") String tradeDate);

}
